#include<bits/stdc++.h>
using namespace std;
const int N = 1e5+10;
int a[N],b[N];
int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    int n,cnt=1;
    scanf("%d",&n);
    for(int i=1;i<=n;i++)
        scanf("%d",&a[i]);
    sort(a+1,a+n+1);
    b[1]=1;
    for(int i=2;i<=n;i++){
        if(a[i]!=a[i-1]) cnt++;
        b[cnt]++;
    }
    int ans=n;
    for(int i=2;i<=cnt;i++){
        ans-=min(b[i],b[i-1]);
        b[i]=max(b[i],b[i-1]);
    }
    printf("%d",ans);
    return 0;
}